-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate eye(::Type{Diagonal{T}}, n), introduce Diagonal[{T}](s::UniformScaling, n) #24415
Conversation
0f04644
to
58e8ddc
Compare
base/linalg/uniformscaling.jl
Outdated
|
||
## Diagonal construction from UniformScaling | ||
Diagonal{T}(s::UniformScaling, m::Integer) where {T} = Diagonal{T}(fill(T(s.λ), m)) | ||
Diagonal(s::UniformScaling, m::Integer) where {T} = Diagonal{eltype(s)}(s, m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing {T}
on UniformScaling
, so either add that and change eltype(s)
to T
or simply remove where {T}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A beautiful example of why one shouldn't make "trivial changes" without retesting 😄. Thanks @fredrikekre
!
Absent objections or requests for time, I plan to merge these changes tomorrow afternoon. Best! |
Thanks all! |
The History.md file linked to JuliaLang#24413 for `eye` deprecation in 0.7. This commit changes it to link to JuliaLang#24415.
This pull request first provides
Diagonal[{T}](s::UniformScaling, n)
constructors as in #24372, and then deprecateseye(::Type{Diagonal{T}}, n)
in favor of those constructors. (Thateye
method is the soleeye
method in base that accepts a container type as argument.) Ref. #11557 (comment) and #23156. Best!